﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="stateCityManager.aspx.cs"
    Inherits="stateCityManager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>省市管理</title>
    <link href="css/shipping.css" rel="stylesheet" type="text/css" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/cs.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
    function delConfirm() {
        var msg = "确定要删除吗?";
        return confirm(msg);    
    }    
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <!--search condition -->
            <table id="searchTab" width="98%">
                <tr>
                    <td>
                        <table id="searchMain">
                            <tr class="b14Text">
                                <td style="width: 50px">
                                    省:
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownListState" runat="server" CssClass="input" DataTextField="stateName"
                                        DataValueField="stateID">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="查询" CausesValidation="False"
                                        CssClass="button" /></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="LabelErrorMsg" runat="server" Text="" ForeColor="red"></asp:Label>
                    </td>
                </tr>
            </table>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="1"
                CellSpacing="1" BorderWidth="0px" BackColor="#C6D5DC" CssClass="biaoresult" AllowPaging="True"
                OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="30" OnRowCommand="GridView1_RowCommand"
                Font-Size="Small">
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <EditRowStyle BackColor="#999999" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" Font-Size="8" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:BoundField DataField="cityName" HeaderText="城市" />
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButtonEdit" runat="server" Text="修改" CommandArgument='<%# Eval("cityID") %>'
                                CommandName="command_edit" CausesValidation="False"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButtonDel" runat="server" CausesValidation="False"
                                        Text="删除" CommandArgument='<%# Eval("cityID") %>' CommandName="command_del"
                                        OnClientClick="javascript:return delConfirm();"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                </Columns>
            </asp:GridView>
            &nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="LinkButtonAdd" runat="server" CausesValidation="False"
                Text="新建城市" OnClick="LinkButtonAdd_Click"></asp:LinkButton>
            <br />
            <br />
            <asp:Panel ID="PanelInput" runat="server" Visible="false">
                <table class="inputTab" width="98%">
                    <asp:Label ID="LabelCityID" runat="server" Visible="false"></asp:Label>
                    <tr>
                        <td>
                            <table class="inputMain">
                                <tr>
                                    <td style="width: 150px">
                                        省:
                                        <asp:Label ID="LabelState" runat="server" Text=""></asp:Label></td>
                                    <td style="width: 50px">
                                        城市<span class="fontRed">*</span></td>
                                    <td>
                                        <asp:TextBox ID="TextBoxCitytName" runat="server" CssClass="input" Width="200px"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                                            ControlToValidate="TextBoxCitytName" /><asp:Button ID="ButtonSubmit" runat="server"
                                                OnClick="ButtonSubmit_Click" Text="保存" CssClass="button" /></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </div>
    </form>
</body>
</html>
